import lib.mavlink as mavlink

class MavlinkParse(object):
    def __init__(self):
        self.process_buff = []
        self.mav = mavlink.MAVLink(None)

    def parse(self, data):
        try:
            m = self.mav.parse_char(data)
            return m
            """
            if m is not None:
                print("Mavlink MSG ID = %d, len=%d" % (m.get_header().msgId, m.get_header().mlen))
                print(m.get_msgbuf().hex(' '), end="\n\n")
            """
        except:
            pass


